﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bdcs.Core.Entity
{
    /// <summary>
    /// wx_userDev数据模型对象
    /// </summary>
    [Serializable]
    public partial class wx_userDevMod
    {
        /// <summary>
        /// 初始化wx_userDev数据模型对象
        /// </summary>
        public wx_userDevMod()
        {
            
        }
        /// <summary>
        /// 初始化wx_userDev数据模型对象并给在SQL中不能为空的字段赋值
        /// </summary>
        /// <param name="iD">ID</param>
        /// <param name="openID">OpenID</param>
        /// <param name="deviceNo">DeviceNo</param>
        /// <param name="cTime">CTime</param>
        public wx_userDevMod(long iD,string openID,string deviceNo,DateTime cTime)
        {
            //给ID字段赋值
            this.ID = iD;
            //给OpenID字段赋值
            this.OpenID = openID;
            //给DeviceNo字段赋值
            this.DeviceNo = deviceNo;
            //给CTime字段赋值
            this.CTime = cTime;
        }
        /// <summary>
        /// 初始化wx_userDev数据模型对象并给所有字段赋值
        /// </summary>
        /// <param name="iD">ID</param>
        /// <param name="openID">OpenID</param>
        /// <param name="deviceNo">DeviceNo</param>
        /// <param name="cTime">CTime</param>
        /// <param name="caption">Caption</param>
        /// <param name="deleted">deleted</param>
        /// <param name="endTime">EndTime</param>
        public wx_userDevMod(long iD,string openID,string deviceNo,DateTime cTime,string caption,int? deleted,DateTime? endTime)
        {
            //给ID字段赋值
            this.ID = iD;
            //给OpenID字段赋值
            this.OpenID = openID;
            //给DeviceNo字段赋值
            this.DeviceNo = deviceNo;
            //给CTime字段赋值
            this.CTime = cTime;
            //给Caption字段赋值
            this.Caption = caption;
            //给deleted字段赋值
            this.Deleted = deleted;
            //给EndTime字段赋值
            this.EndTime = endTime;
        }
        
		//属性存储数据的变量
        private long _iD;
        private string _openID;
        private string _deviceNo;
        private DateTime _cTime;
        private string _caption;
        private int? _deleted;
        private DateTime? _endTime;
        
        /// <summary>
        /// ID
        /// </summary>
        public long ID
        {
            get { return this._iD; }
            set { this._iD = value; }
        }
        /// <summary>
        /// OpenID
        /// </summary>
        public string OpenID
        {
            get { return this._openID; }
            set { this._openID = value; }
        }
        /// <summary>
        /// DeviceNo
        /// </summary>
        public string DeviceNo
        {
            get { return this._deviceNo; }
            set { this._deviceNo = value; }
        }
        /// <summary>
        /// CTime
        /// </summary>
        public DateTime CTime
        {
            get { return this._cTime; }
            set { this._cTime = value; }
        }
        /// <summary>
        /// Caption
        /// </summary>
        public string Caption
        {
            get { return this._caption; }
            set { this._caption = value; }
        }
        /// <summary>
        /// deleted
        /// </summary>
        public int? Deleted
        {
            get { return this._deleted; }
            set { this._deleted = value; }
        }
        /// <summary>
        /// EndTime
        /// </summary>
        public DateTime? EndTime
        {
            get { return this._endTime; }
            set { this._endTime = value; }
        }
        
        /// <summary>
        /// 对比两个wx_userDev数据模型对象是否一致
        /// </summary>
        /// <param name="obj">要进行比对的wx_userDev数据模型对象</param>
        /// <returns>返回是否一致，为true一致，为false不一致</returns>
        public override bool Equals(object obj)
        {
            //判断传入对象是否为null
            if (obj == null) return false;
            //将传入对象转换成wx_userDev数据模型对象
            wx_userDevMod wx_userDevMod = obj as wx_userDevMod;
            //判断是否转换成功
            if (wx_userDevMod == null) return false;
            //进行匹配属性的值
            return
                //判断ID是否一致
                this.ID == wx_userDevMod.ID &&
                //判断OpenID是否一致
                this.OpenID == wx_userDevMod.OpenID &&
                //判断DeviceNo是否一致
                this.DeviceNo == wx_userDevMod.DeviceNo &&
                //判断CTime是否一致
                this.CTime == wx_userDevMod.CTime &&
                //判断Caption是否一致
                this.Caption == wx_userDevMod.Caption &&
                //判断deleted是否一致
                this.Deleted == wx_userDevMod.Deleted &&
                //判断EndTime是否一致
                this.EndTime == wx_userDevMod.EndTime;
        }
        /// <summary>
        /// 将当前wx_userDev数据模型对象转换成哈希码
        /// </summary>
        /// <returns>哈希值</returns>
        public override int GetHashCode()
        {
            //将wx_userDev数据模型对象的属性进行按位异或运算处理得到哈希码并返回
            return
                //将ID进行按位异或运算处理
                this.ID.GetHashCode() ^
                //将OpenID进行按位异或运算处理
                (this.OpenID == null ? 2147483647 : this.OpenID.GetHashCode()) ^
                //将DeviceNo进行按位异或运算处理
                (this.DeviceNo == null ? 2147483647 : this.DeviceNo.GetHashCode()) ^
                //将CTime进行按位异或运算处理
                this.CTime.GetHashCode() ^
                //将Caption进行按位异或运算处理
                (this.Caption == null ? 2147483647 : this.Caption.GetHashCode()) ^
                //将deleted进行按位异或运算处理
                (this.Deleted == null ? 2147483647 : this.Deleted.GetHashCode()) ^
                //将EndTime进行按位异或运算处理
                (this.EndTime == null ? 2147483647 : this.EndTime.GetHashCode());
        }
        /// <summary>
        /// 将当前wx_userDev数据模型对象转换成字符串副本【仅显示在SQL中不能为空的列】
        /// </summary>
        /// <returns>字符串形式副本</returns>
        public override string ToString()
        {
            //将当前wx_userDev数据模型对象转换成字符串副本
            return
                "[" +
                //将ID转换成字符串
                this.ID + "," +
                //将OpenID转换成字符串
                this.OpenID + "," +
                //将DeviceNo转换成字符串
                this.DeviceNo + "," +
                //将CTime转换成字符串
                this.CTime +
                "]";
        }
    }
}
